// source --> //www.invisalignbarcelona.com/wp-content/themes/Avada/includes/lib/assets/min/js/library/jquery.ilightbox.js?ver=2.2 !function($,window,undefined){function getPixel(a,b){return parseInt(a.css(b),10)||0}function within(a,b,c){return ac?c:a}function getViewport(){var a=window,b="inner";return"innerWidth"in window||(b="client",a=document.documentElement||document.body),{width:a[b+"Width"],height:a[b+"Height"]}}function removeHash(){history&&history.pushState&&history.pushState("",document.title,window.location.pathname+window.location.search)}function doAjax(a,b){var a="http://ilightbox.net/getSource/jsonp.php?url="+encodeURIComponent(a).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");$.ajax({url:a,dataType:"jsonp"}),iLCallback=function(a){b.call(this,a)}}function findImageInElement(a){var b=$("*",a),c=new Array;return b.each(function(){var a="",b=this;if("none"!=$(b).css("background-image")?a=$(b).css("background-image"):void 0!==$(b).attr("src")&&"img"==b.nodeName.toLowerCase()&&(a=$(b).attr("src")),-1==a.indexOf("gradient")){a=a.replace(/url\(\"/g,""),a=a.replace(/url\(/g,""),a=a.replace(/\"\)/g,""),a=a.replace(/\)/g,"");for(var d=a.split(","),e=0;e0&&-1==$.inArray(d[e],c)){var f="";browser.msie&&browser.version<9&&(f="?"+floor(3e3*random())),c.push(d[e]+f)}}}),c}function getExtension(a){var b=a?a.split(".").pop().toLowerCase():"",c=-1!==b.indexOf("?")?"?"+b.split("?").pop():"";return b.replace(c,"")}function getTypeByExtension(a){var b=getExtension(a);return-1!==extensions.image.indexOf(b)?"image":-1!==extensions.flash.indexOf(b)?"flash":-1!==extensions.video.indexOf(b)?"video":"iframe"}function percentToValue(a,b){return parseInt(b/100*a)}function parseURI(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null}function absolutizeURI(a,b){return b=parseURI(b||""),a=parseURI(a||""),b&&a?(b.protocol||a.protocol)+(b.protocol||b.authority?b.authority:a.authority)+function(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}(b.protocol||b.authority||"/"===b.pathname.charAt(0)?b.pathname:b.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+b.pathname:a.pathname)+(b.protocol||b.authority||b.pathname?b.search:b.search||a.search)+b.hash:null}function version_compare(a,b,c){this.php_js=this.php_js||{},this.php_js.ENV=this.php_js.ENV||{};var d=0,e=0,f=0,g={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},h=function(a){return a=(""+a).replace(/[_\-+]/g,"."),a=a.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),a.length?a.split("."):[-8]},i=function(a){return a?isNaN(a)?g[a]||-7:parseInt(a,10):0};for(a=h(a),b=h(b),e=max(a.length,b.length),d=0;db[d]){f=1;break}}if(!c)return f;switch(c){case">":case"gt":return f>0;case">=":case"ge":return f>=0;case"<=":case"le":return f<=0;case"==":case"=":case"eq":return 0===f;case"<>":case"!=":case"ne":return 0!==f;case"":case"<":case"lt":return f<0;default:return null}}function getScrollXY(){var a=0,b=0;return"number"==typeof window.pageYOffset?(b=window.pageYOffset,a=window.pageXOffset):document.body&&(document.body.scrollLeft||document.body.scrollTop)?(b=document.body.scrollTop,a=document.body.scrollLeft):document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)&&(b=document.documentElement.scrollTop,a=document.documentElement.scrollLeft),{x:a,y:b}}function AC_QuickTimeVersion(){return gQTGeneratorVersion}function _QTComplain(a,b){b=b.replace("%%",a),alert(b)}function _QTAddAttribute(a,b,c){var d;return d=gTagAttrs[a+b],null==d&&(d=gTagAttrs[b]),null!=d?(0==b.indexOf(a)&&null==c&&(c=b.substring(a.length)),null==c&&(c=b),c+'="'+d+'" '):""}function _QTAddObjectAttr(a,b){return 0==a.indexOf("emb#")?"":(0==a.indexOf("obj#")&&null==b&&(b=a.substring(4)),_QTAddAttribute("obj#",a,b))}function _QTAddEmbedAttr(a,b){return 0==a.indexOf("obj#")?"":(0==a.indexOf("emb#")&&null==b&&(b=a.substring(4)),_QTAddAttribute("emb#",a,b))}function _QTAddObjectParam(a,b){var c,d="",e=b?" />":">";return-1==a.indexOf("emb#")&&(c=gTagAttrs["obj#"+a],null==c&&(c=gTagAttrs[a]),0==a.indexOf("obj#")&&(a=a.substring(4)),null!=c&&(d=' c.length||0!=c.length%2)return _QTComplain(a,gArgCountErr),"";gTagAttrs=[],gTagAttrs.src=c[0],gTagAttrs.width=c[1],gTagAttrs.height=c[2],gTagAttrs.classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",gTagAttrs.pluginspage="http://www.apple.com/quicktime/download/",a=c[3],null!=a&&""!=a||(a="6,0,2,0"),gTagAttrs.codebase="http://www.apple.com/qtactivex/qtplugin.cab#version="+a;for(var d,e=4;e\n"+_QTAddObjectParam("src",b),e=" \n"}function QT_GenerateOBJECTText(){return _QTGenerate("QT_GenerateOBJECTText",!1,arguments)}var extensions={flash:["swf"],image:["bmp","gif","jpeg","jpg","png","tiff","tif","jfif","jpe"],iframe:["asp","aspx","cgi","cfm","htm","html","jsp","php","pl","php3","php4","php5","phtml","rb","rhtml","shtml","txt"],video:["avi","mov","mpg","mpeg","movie","mp4","webm","ogv","ogg","3gp","m4v"]},$win=$(window),$doc=$(document),browser,transform,gpuAcceleration,fullScreenApi="",supportTouch=!!("ontouchstart"in window)&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),clickEvent=supportTouch?"itap":"click",globalClickEvent=supportTouch?"itap":"click",touchStartEvent=supportTouch?"touchstart.iLightBox":"mousedown.iLightBox",touchStopEvent=supportTouch?"touchend.iLightBox":"mouseup.iLightBox",touchMoveEvent=supportTouch?"touchmove.iLightBox":"mousemove.iLightBox",abs=Math.abs,sqrt=Math.sqrt,round=Math.round,max=Math.max,min=Math.min,floor=Math.floor,random=Math.random,pluginspages={quicktime:"http://www.apple.com/quicktime/download",flash:"http://www.adobe.com/go/getflash"},iLightBox=function(a,b,c,d){var e=this;if(e.options=b,e.selector=a.selector||a,e.context=a.context,e.instant=d,c.length<1?e.attachItems():e.items=c,e.vars={total:e.items.length,start:0,current:null,next:null,prev:null,BODY:$("body"),loadRequests:0,overlay:$('
'),loader:$('
'),toolbar:$('
'),innerToolbar:$('
'),title:$('
'),closeButton:$(''),fullScreenButton:$(''),innerPlayButton:$(''),innerNextButton:$(''),innerPrevButton:$(''),holder:$('
'),nextPhoto:$('
'),prevPhoto:$('
'),nextButton:$(''),prevButton:$(''),thumbnails:$('
'),thumbs:!1,nextLock:!1,prevLock:!1,hashLock:!1,isMobile:!1,mobileMaxWidth:980,isInFullScreen:!1,isSwipe:!1,mouseID:0,cycleID:0,isPaused:0},e.vars.hideableElements=e.vars.nextButton.add(e.vars.prevButton),e.normalizeItems(),e.availPlugins(),e.options.startFrom=e.options.startFrom>0&&e.options.startFrom>=e.vars.total?e.vars.total-1:e.options.startFrom,e.options.startFrom=e.options.randomStart?floor(random()*e.vars.total):e.options.startFrom,e.vars.start=e.options.startFrom,d?e.instantCall():e.patchItemsEvents(),e.options.linkId&&(e.hashChangeHandler(),$win.iLightBoxHashChange(function(){e.hashChangeHandler()})),supportTouch){var f=/(click|mouseenter|mouseleave|mouseover|mouseout)/gi;e.options.caption.show=e.options.caption.show.replace(f,"itap"),e.options.caption.hide=e.options.caption.hide.replace(f,"itap"),e.options.social.show=e.options.social.show.replace(f,"itap"),e.options.social.hide=e.options.social.hide.replace(f,"itap")}e.options.controls.arrows&&$.extend(e.options.styles,{nextOffsetX:0,prevOffsetX:0,nextOpacity:0,prevOpacity:0})};iLightBox.prototype={showLoader:function(){var a=this;a.vars.loadRequests+=1,"horizontal"==a.options.path.toLowerCase()?a.vars.loader.stop().animate({top:"-30px"},a.options.show.speed,"easeOutCirc"):a.vars.loader.stop().animate({left:"-30px"},a.options.show.speed,"easeOutCirc")},hideLoader:function(){var a=this;a.vars.loadRequests-=1,a.vars.loadRequests=a.vars.loadRequests<0?0:a.vars.loadRequests,"horizontal"==a.options.path.toLowerCase()?a.vars.loadRequests<=0&&a.vars.loader.stop().animate({top:"-192px"},a.options.show.speed,"easeInCirc"):a.vars.loadRequests<=0&&a.vars.loader.stop().animate({left:"-192px"},a.options.show.speed,"easeInCirc")},createUI:function(){var a=this;a.ui={currentElement:a.vars.holder,nextElement:a.vars.nextPhoto,prevElement:a.vars.prevPhoto,currentItem:a.vars.current,nextItem:a.vars.next,prevItem:a.vars.prev,hide:function(){a.closeAction()},refresh:function(){arguments.length>0?a.repositionPhoto(!0):a.repositionPhoto()},fullscreen:function(){a.fullScreenAction()}}},attachItems:function(){var iL=this,itemsObject=new Array,items=new Array;$(iL.selector,iL.context).each(function(){var t=$(this),URL=t.attr(iL.options.attr)||null,options=t.data("options")&&eval("({"+t.data("options")+"})")||{},caption=t.data("caption"),title=t.data("title"),type=t.data("type")||getTypeByExtension(URL);items.push({URL:URL,caption:caption,title:title,type:type,options:options}),iL.instant||itemsObject.push(t)}),iL.items=items,iL.itemsObject=itemsObject,iL.vars&&(iL.vars.total=items.length)},normalizeItems:function(){var a=this,b=new Array;$.each(a.items,function(c,d){"string"==typeof d&&(d={url:d});var e=d.url||d.URL||null,f=d.options||{},g=d.caption||null,h=d.title||null,i=d.type?d.type.toLowerCase():getTypeByExtension(e),j="object"!=typeof e?getExtension(e):"";f.thumbnail=f.thumbnail||("image"==i?e:null),f.videoType=f.videoType||null,f.skin=f.skin||a.options.skin,f.width=f.width||null,f.height=f.height||null,f.mousewheel=void 0===f.mousewheel||f.mousewheel,f.swipe=void 0===f.swipe||f.swipe,f.social=void 0!==f.social?f.social:a.options.social.buttons&&$.extend({},{},a.options.social.buttons),"video"==i&&(f.html5video=void 0!==f.html5video?f.html5video:{},f.html5video.webm=f.html5video.webm||f.html5video.WEBM||null,f.html5video.controls=void 0!==f.html5video.controls?f.html5video.controls:"controls",f.html5video.preload=f.html5video.preload||"metadata",f.html5video.autoplay=void 0!==f.html5video.autoplay&&f.html5video.autoplay),f.width&&f.height||("video"==i?(f.width=fusionLightboxVideoVars.lightbox_video_width,f.height=fusionLightboxVideoVars.lightbox_video_height):"iframe"==i?(f.width=fusionLightboxVideoVars.lightbox_video_width,f.height=fusionLightboxVideoVars.lightbox_video_height):"flash"==i&&(f.width=fusionLightboxVideoVars.lightbox_video_width,f.height=fusionLightboxVideoVars.lightbox_video_height)),delete d.url,d.index=c,d.URL=e,d.caption=g,d.title=h,d.type=i,d.options=f,d.ext=j,b.push(d)}),a.items=b},instantCall:function(){var a=this,b=a.vars.start;a.vars.current=b,a.vars.next=a.items[b+1]?b+1:null,a.vars.prev=a.items[b-1]?b-1:null,a.addContents(),a.patchEvents()},addContents:function(){var a=this,b=a.vars,c=a.options,d=getViewport(),e=c.path.toLowerCase(),f=b.total>0&&a.items.filter(function(a,b,d){return-1===["image","flash","video"].indexOf(a.type)&&void 0===a.recognized&&(c.smartRecognition||a.options.smartRecognition)}),g=f.length>0;c.mobileOptimizer&&!c.innerToolbar&&(b.isMobile=d.width<=b.mobileMaxWidth),b.overlay.addClass(c.skin).hide().css("opacity",c.overlay.opacity),c.linkId&&b.overlay[0].setAttribute("linkid",c.linkId),c.controls.toolbar&&(b.toolbar.addClass(c.skin).append(b.closeButton),c.controls.fullscreen&&b.toolbar.append(b.fullScreenButton),c.controls.slideshow&&b.toolbar.append(b.innerPlayButton),b.total>1&&b.toolbar.append(b.innerPrevButton).append(b.innerNextButton)),b.BODY.addClass("ilightbox-noscroll").append(b.overlay).append(b.loader).append(b.holder).append(b.nextPhoto).append(b.prevPhoto),c.innerToolbar||b.BODY.append(b.toolbar),c.controls.arrows&&b.BODY.append(b.nextButton).append(b.prevButton),c.controls.thumbnail&&b.total>1&&(b.BODY.append(b.thumbnails),b.thumbnails.addClass(c.skin).addClass("ilightbox-"+e),$("div.ilightbox-thumbnails-grid",b.thumbnails).empty(),b.thumbs=!0);var h="horizontal"==c.path.toLowerCase()?{left:parseInt(d.width/2-b.loader.outerWidth()/2)}:{top:parseInt(d.height/2-b.loader.outerHeight()/2)};b.loader.addClass(c.skin).css(h),b.nextButton.add(b.prevButton).addClass(c.skin),"horizontal"==e&&b.loader.add(b.nextButton).add(b.prevButton).addClass("horizontal"),b.BODY[b.isMobile?"addClass":"removeClass"]("isMobile"),c.infinite||(b.prevButton.add(b.prevButton).add(b.innerPrevButton).add(b.innerNextButton).removeClass("disabled"),b.nextButton.add(b.prevButton).add(b.innerPrevButton).add(b.innerNextButton).removeClass("disabled"),0==b.current&&b.prevButton.add(b.innerPrevButton).addClass("disabled"),b.current>=b.total-1&&b.nextButton.add(b.innerNextButton).addClass("disabled")),c.show.effect?(b.overlay.stop().fadeIn(c.show.speed),b.toolbar.stop().fadeIn(c.show.speed)):(b.overlay.show(),b.toolbar.show());var i=f.length;g?(a.showLoader(),$.each(f,function(d,e){var f=function(d){var e=-1,f=(a.items.filter(function(a,b,c){return a.URL==d.url&&(e=b),a.URL==d.url}),a.items[e]);d&&$.extend(!0,f,{URL:d.source,type:d.type,recognized:!0,options:{html5video:d.html5video,width:"image"==d.type?0:d.width||f.width,height:"image"==d.type?0:d.height||f.height,thumbnail:f.options.thumbnail||d.thumbnail}}),0==--i&&(a.hideLoader(),b.dontGenerateThumbs=!1,a.generateThumbnails(),c.show.effect?setTimeout(function(){a.generateBoxes()},c.show.speed):a.generateBoxes())};a.ogpRecognition(this,f)})):c.show.effect?setTimeout(function(){a.generateBoxes()},c.show.speed):a.generateBoxes(),a.createUI(),window.iLightBox={close:function(){a.closeAction()},fullscreen:function(){a.fullScreenAction()},moveNext:function(){a.moveTo("next")},movePrev:function(){a.moveTo("prev")},goTo:function(b){a.goTo(b)},refresh:function(){a.refresh()},reposition:function(){arguments.length>0?a.repositionPhoto(!0):a.repositionPhoto()},setOption:function(b){a.setOption(b)},destroy:function(){a.closeAction(),a.dispatchItemsEvents()}},c.linkId&&(b.hashLock=!0,window.location.hash=c.linkId+"/"+b.current,setTimeout(function(){b.hashLock=!1},55)),c.slideshow.startPaused||(a.resume(),b.innerPlayButton.removeClass("ilightbox-play").addClass("ilightbox-pause")),"function"==typeof a.options.callback.onOpen&&a.options.callback.onOpen.call(a)},loadContent:function(a,b,c){var d,e,f=this;switch(f.createUI(),a.speed=c||f.options.effects.loadedFadeSpeed,"current"==b&&(a.options.mousewheel?f.vars.lockWheel=!1:f.vars.lockWheel=!0,a.options.swipe?f.vars.lockSwipe=!1:f.vars.lockSwipe=!0),b){case"current":d=f.vars.holder,e=f.vars.current;break;case"next":d=f.vars.nextPhoto,e=f.vars.next;break;case"prev":d=f.vars.prevPhoto,e=f.vars.prev}if(d.removeAttr("style class").addClass("ilightbox-holder"+(supportTouch?" supportTouch":"")).addClass(a.options.skin),$("div.ilightbox-inner-toolbar",d).remove(),a.title||f.options.innerToolbar){var g=f.vars.innerToolbar.clone();if(a.title&&f.options.show.title){var h=f.vars.title.clone();h.empty().html(a.title),g.append(h)}f.options.innerToolbar&&g.append(f.vars.total>1?f.vars.toolbar.clone():f.vars.toolbar),d.prepend(g)}f.loadSwitcher(a,d,e,b)},loadSwitcher:function(a,b,c,d){var e=this,g=e.options,h={element:b,position:c};switch(a.type){case"image":"function"==typeof g.callback.onBeforeLoad&&g.callback.onBeforeLoad.call(e,e.ui,c),"function"==typeof a.options.onBeforeLoad&&a.options.onBeforeLoad.call(e,h),e.loadImage(a.URL,function(f){"function"==typeof g.callback.onAfterLoad&&g.callback.onAfterLoad.call(e,e.ui,c),"function"==typeof a.options.onAfterLoad&&a.options.onAfterLoad.call(e,h);var i=f?f.width:400,j=f?f.height:200;b.data({naturalWidth:i,naturalHeight:j}),$("div.ilightbox-container",b).empty().append(f?'':''+g.errors.loadImage+""),"function"==typeof g.callback.onRender&&g.callback.onRender.call(e,e.ui,c),"function"==typeof a.options.onRender&&a.options.onRender.call(e,h),e.configureHolder(a,d,b)});break;case"video":b.data({naturalWidth:a.options.width,naturalHeight:a.options.height}),e.addContent(b,a),"function"==typeof g.callback.onRender&&g.callback.onRender.call(e,e.ui,c),"function"==typeof a.options.onRender&&a.options.onRender.call(e,h),e.configureHolder(a,d,b);break;case"iframe":for(var i=a.URL.substring(a.URL.indexOf("?")+1).split("&"),j={},k=0;k').css(o).html(k)),b.show().data({naturalWidth:m||l.outerWidth(),naturalHeight:n||l.outerHeight()}).hide(),"function"==typeof g.callback.onRender&&g.callback.onRender.call(e,e.ui,c),"function"==typeof a.options.onRender&&a.options.onRender.call(e,h);var q=findImageInElement(b);e.loadImage(q,function(){"function"==typeof g.callback.onAfterLoad&&g.callback.onAfterLoad.call(e,e.ui,c),"function"==typeof a.options.onAfterLoad&&a.options.onAfterLoad.call(e,h),e.configureHolder(a,d,b)}),g.ajaxSetup.success(f,i,j),"function"==typeof p.success&&p.success(f,i,j)},error:function(i,j,k){"function"==typeof g.callback.onAfterLoad&&g.callback.onAfterLoad.call(e,e.ui,c),"function"==typeof a.options.onAfterLoad&&a.options.onAfterLoad.call(e,h),f,e.hideLoader(),$("div.ilightbox-container",b).empty().append(''+g.errors.loadContents+""),e.configureHolder(a,d,b),g.ajaxSetup.error(i,j,k),"function"==typeof p.error&&p.error(i,j,k)}});break;case"html":var m,q=a.URL;if(container=$("div.ilightbox-container",b),q[0].nodeName)m=q.clone();else{var r=$(q);m=r.selector?$("
"+r+"
"):r}var s=e.items[c].options.width||parseInt(m.attr("width")),t=e.items[c].options.height||parseInt(m.attr("height"));e.addContent(b,a),m.appendTo(document.documentElement).hide(),"function"==typeof g.callback.onRender&&g.callback.onRender.call(e,e.ui,c),"function"==typeof a.options.onRender&&a.options.onRender.call(e,h);var o=findImageInElement(b);"function"==typeof g.callback.onBeforeLoad&&g.callback.onBeforeLoad.call(e,e.ui,c),"function"==typeof a.options.onBeforeLoad&&a.options.onBeforeLoad.call(e,h),e.loadImage(o,function(){"function"==typeof g.callback.onAfterLoad&&g.callback.onAfterLoad.call(e,e.ui,c),"function"==typeof a.options.onAfterLoad&&a.options.onAfterLoad.call(e,h),b.show().data({naturalWidth:s||container.outerWidth(),naturalHeight:t||container.outerHeight()}).hide(),m.remove(),e.configureHolder(a,d,b)})}},configureHolder:function(a,b,c){var d=this,e=d.vars,f=d.options;if("current"!=b&&("next"==b?c.addClass("ilightbox-next"):c.addClass("ilightbox-prev")),"current"==b)var g=e.current;else if("next"==b)var h=f.styles.nextOpacity,g=e.next;else var h=f.styles.prevOpacity,g=e.prev;var i={element:c,position:g};d.items[g].options.width=d.items[g].options.width||0,d.items[g].options.height=d.items[g].options.height||0,"current"==b?f.show.effect?c.css(transform,gpuAcceleration).fadeIn(a.speed,function(){if(c.css(transform,""),a.caption){d.setCaption(a,c);var b=$("div.ilightbox-caption",c),e=parseInt(b.outerHeight()/c.outerHeight()*100);f.caption.start&e<=50&&b.fadeIn(f.effects.fadeSpeed)}var h=a.options.social;h&&(d.setSocial(h,a.URL,c),f.social.start&&$("div.ilightbox-social",c).fadeIn(f.effects.fadeSpeed)),d.generateThumbnails(),"function"==typeof f.callback.onShow&&f.callback.onShow.call(d,d.ui,g),"function"==typeof a.options.onShow&&a.options.onShow.call(d,i)}):(c.show(),d.generateThumbnails(),"function"==typeof f.callback.onShow&&f.callback.onShow.call(d,d.ui,g),"function"==typeof a.options.onShow&&a.options.onShow.call(d,i)):f.show.effect?c.fadeTo(a.speed,h,function(){"next"==b?e.nextLock=!1:e.prevLock=!1,d.generateThumbnails(),"function"==typeof f.callback.onShow&&f.callback.onShow.call(d,d.ui,g),"function"==typeof a.options.onShow&&a.options.onShow.call(d,i)}):(c.css({opacity:h}).show(),"next"==b?e.nextLock=!1:e.prevLock=!1,d.generateThumbnails(),"function"==typeof f.callback.onShow&&f.callback.onShow.call(d,d.ui,g),"function"==typeof a.options.onShow&&a.options.onShow.call(d,i)),setTimeout(function(){d.repositionPhoto()},0)},generateBoxes:function(){var a=this,b=a.vars,c=a.options;c.infinite&&b.total>=3?(b.current==b.total-1&&(b.next=0),0==b.current&&(b.prev=b.total-1)):c.infinite=!1,a.loadContent(a.items[b.current],"current",c.show.speed),a.items[b.next]&&a.loadContent(a.items[b.next],"next",c.show.speed),a.items[b.prev]&&a.loadContent(a.items[b.prev],"prev",c.show.speed)},generateThumbnails:function(){var a=this,b=a.vars,c=a.options,d=null;if(b.thumbs&&!a.vars.dontGenerateThumbs){var e=b.thumbnails,f=$("div.ilightbox-thumbnails-container",e),g=$("div.ilightbox-thumbnails-grid",f),h=0;g.removeAttr("style").empty(),$.each(a.items,function(i,j){var k=b.current==i?"ilightbox-active":"",l=b.current==i?c.thumbnails.activeOpacity:c.thumbnails.normalOpacity,m=j.options.thumbnail,n=$('
'),o=$('
');n.css({opacity:0}).addClass(k),"video"!=j.type&&"flash"!=j.type||void 0!==j.options.icon?j.options.icon&&(o.addClass("ilightbox-thumbnail-"+j.options.icon),n.append(o)):(o.addClass("ilightbox-thumbnail-video"),n.append(o)),m&&a.loadImage(m,function(b){h++,b?n.data({naturalWidth:b.width,naturalHeight:b.height}).append(''):n.data({naturalWidth:c.thumbnails.maxWidth,naturalHeight:c.thumbnails.maxHeight}),clearTimeout(d),d=setTimeout(function(){a.positionThumbnails(e,f,g)},20),setTimeout(function(){n.fadeTo(c.effects.loadedFadeSpeed,l)},20*h)}),g.append(n)}),a.vars.dontGenerateThumbs=!0}},positionThumbnails:function(a,b,c){var d=this,e=d.vars,f=d.options,g=getViewport(),h=f.path.toLowerCase();a||(a=e.thumbnails),b||(b=$("div.ilightbox-thumbnails-container",a)),c||(c=$("div.ilightbox-thumbnails-grid",b));var i=$(".ilightbox-thumbnail",c),j="horizontal"==h?g.width-f.styles.pageOffsetX:i.eq(0).outerWidth()-f.styles.pageOffsetX,k="horizontal"==h?i.eq(0).outerHeight()-f.styles.pageOffsetY:g.height-f.styles.pageOffsetY,l="horizontal"==h?0:j,m="horizontal"==h?k:0,n=$(".ilightbox-active",c),o={};arguments.length<3&&(i.css({opacity:f.thumbnails.normalOpacity}),n.css({opacity:f.thumbnails.activeOpacity})),i.each(function(a){var b=$(this),c=b.data(),e="horizontal"==h?0:f.thumbnails.maxWidth;height="horizontal"==h?f.thumbnails.maxHeight:0,dims=d.getNewDimenstions(e,height,c.naturalWidth,c.naturalHeight,!0),b.css({width:dims.width,height:dims.height}),"horizontal"==h&&b.css({float:"left"}),"horizontal"==h?l+=b.outerWidth():m+=b.outerHeight()}),o={width:l,height:m},c.css(o),o={};var p=c.offset(),q=n.length?n.offset():{top:parseInt(k/2),left:parseInt(j/2)};p.top=p.top-$doc.scrollTop(),p.left=p.left-$doc.scrollLeft(),q.top=q.top-p.top-$doc.scrollTop(),q.left=q.left-p.left-$doc.scrollLeft(),"horizontal"==h?(o.top=0,o.left=parseInt(j/2-q.left-n.outerWidth()/2)):(o.top=parseInt(k/2-q.top-n.outerHeight()/2),o.left=0),arguments.length<3?c.stop().animate(o,f.effects.repositionSpeed,"easeOutCirc"):c.css(o)},loadImage:function(a,b){$.isArray(a)||(a=[a]);var c=this,d=a.length;d>0?(c.showLoader(),$.each(a,function(e,f){var g=new Image;g.onload=function(){0==(d-=1)&&(c.hideLoader(),b(g))},g.onerror=g.onabort=function(){0==(d-=1)&&(c.hideLoader(),b(!1))},g.src=a[e]})):b(!1)},patchItemsEvents:function(){var a=this,b=a.vars,c=supportTouch?"itap.iL":"click.iL",d=supportTouch?"click.iL":"itap.iL";if(a.context&&a.selector){var e=$(a.selector,a.context);$(a.context).on(c,a.selector,function(){var c=$(this),d=e.index(c);return b.current=d,b.next=a.items[d+1]?d+1:null,b.prev=a.items[d-1]?d-1:null,a.addContents(),a.patchEvents(),!1}).on(d,a.selector,function(){return!1})}else $.each(a.itemsObject,function(e,f){f.on(c,function(){return b.current=e,b.next=a.items[e+1]?e+1:null,b.prev=a.items[e-1]?e-1:null,a.addContents(),a.patchEvents(),!1}).on(d,function(){return!1})})},dispatchItemsEvents:function(){var a=this;a.vars,a.options;a.context&&a.selector?$(a.context).off(".iL",a.selector):$.each(a.itemsObject,function(a,b){b.off(".iL")})},refresh:function(){var a=this;a.dispatchItemsEvents(),a.attachItems(),a.normalizeItems(),a.patchItemsEvents()},patchEvents:function(){function a(a){c.isMobile||(c.mouseID||c.hideableElements.show(),c.mouseID=clearTimeout(c.mouseID),-1===i.indexOf(a.target)&&(c.mouseID=setTimeout(function(){c.hideableElements.hide(),c.mouseID=clearTimeout(c.mouseID)},3e3)))}var b=this,c=b.vars,d=b.options,e=d.path.toLowerCase(),f=$(".ilightbox-holder"),g=fullScreenApi.fullScreenEventName+".iLightBox",h=verticalDistanceThreshold=100,i=[c.nextButton[0],c.prevButton[0],c.nextButton[0].firstChild,c.prevButton[0].firstChild];$win.bind("resize.iLightBox",function(){var a=getViewport();d.mobileOptimizer&&!d.innerToolbar&&(c.isMobile=a.width<=c.mobileMaxWidth),c.BODY[c.isMobile?"addClass":"removeClass"]("isMobile"),b.repositionPhoto(null),supportTouch&&(clearTimeout(c.setTime),c.setTime=setTimeout(function(){var a=getScrollXY().y;window.scrollTo(0,a-30),window.scrollTo(0,a+30),window.scrollTo(0,a)},2e3)),c.thumbs&&b.positionThumbnails()}).bind("keydown.iLightBox",function(a){if(d.controls.keyboard)switch(a.keyCode){case 13:a.shiftKey&&d.keyboard.shift_enter&&b.fullScreenAction();break;case 27:d.keyboard.esc&&b.closeAction();break;case 37:d.keyboard.left&&!c.lockKey&&b.moveTo("prev");break;case 38:d.keyboard.up&&!c.lockKey&&b.moveTo("prev");break;case 39:d.keyboard.right&&!c.lockKey&&b.moveTo("next");break;case 40:d.keyboard.down&&!c.lockKey&&b.moveTo("next")}}),fullScreenApi.supportsFullScreen&&$win.bind(g,function(){b.doFullscreen()});var j=[d.caption.show+".iLightBox",d.caption.hide+".iLightBox",d.social.show+".iLightBox",d.social.hide+".iLightBox"].filter(function(a,b,c){return c.lastIndexOf(a)===b}),k="";$.each(j,function(a,b){0!=a&&(k+=" "),k+=b}),$doc.on(clickEvent,".ilightbox-overlay",function(){d.overlay.blur&&b.closeAction()}).on(clickEvent,".ilightbox-next, .ilightbox-next-button",function(){b.moveTo("next")}).on(clickEvent,".ilightbox-prev, .ilightbox-prev-button",function(){b.moveTo("prev")}).on(clickEvent,".ilightbox-thumbnail",function(){var a=$(this),d=$(".ilightbox-thumbnail",c.thumbnails),e=d.index(a);e!=c.current&&b.goTo(e)}).on(k,".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(a){var b=$("div.ilightbox-caption",c.holder),e=$("div.ilightbox-social",c.holder),f=d.effects.fadeSpeed;c.nextLock||c.prevLock?(a.type!=d.caption.show||b.is(":visible")?a.type==d.caption.hide&&b.is(":visible")&&b.fadeOut(f):b.fadeIn(f), a.type!=d.social.show||e.is(":visible")?a.type==d.social.hide&&e.is(":visible")&&e.fadeOut(f):e.fadeIn(f)):(a.type!=d.caption.show||b.is(":visible")?a.type==d.caption.hide&&b.is(":visible")&&b.stop().fadeOut(f):b.stop().fadeIn(f),a.type!=d.social.show||e.is(":visible")?a.type==d.social.hide&&e.is(":visible")&&e.stop().fadeOut(f):e.stop().fadeIn(f))}).on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-wrapper",function(a){"mouseenter"==a.type?c.lockWheel=!0:c.lockWheel=!1}).on(clickEvent,".ilightbox-toolbar a.ilightbox-close, .ilightbox-toolbar a.ilightbox-fullscreen, .ilightbox-toolbar a.ilightbox-play, .ilightbox-toolbar a.ilightbox-pause",function(a){var c=$(this);c.hasClass("ilightbox-fullscreen")?b.fullScreenAction():c.hasClass("ilightbox-play")?(b.resume(),c.addClass("ilightbox-pause").removeClass("ilightbox-play")):c.hasClass("ilightbox-pause")?(b.pause(),c.addClass("ilightbox-play").removeClass("ilightbox-pause")):b.closeAction()}).on(touchMoveEvent,".ilightbox-overlay, .ilightbox-thumbnails-container",function(a){a.preventDefault()}),d.controls.arrows&&!supportTouch&&$doc.on("mousemove.iLightBox",a),d.controls.slideshow&&d.slideshow.pauseOnHover&&$doc.on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(a){"mouseenter"==a.type&&c.cycleID?b.pause():"mouseleave"==a.type&&c.isPaused&&b.resume()});var l=$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails");d.controls.mousewheel&&l.on("mousewheel.iLightBox",function(a,d){c.lockWheel||(a.preventDefault(),d<0?b.moveTo("next"):d>0&&b.moveTo("prev"))}),d.controls.swipe&&f.on(touchStartEvent,function(a){function g(a){var b=$(this),c=p[a],d=[q.coords[0]-k.coords[0],q.coords[1]-k.coords[1]];b[0].style["horizontal"==e?"left":"top"]=("horizontal"==e?c.left-d[0]:c.top-d[1])+"px"}function i(a){if(q){var b=a.originalEvent.touches?a.originalEvent.touches[0]:a;k={time:(new Date).getTime(),coords:[b.pageX-n,b.pageY-m]},f.each(g),a.preventDefault()}}function j(){f.each(function(){var a=$(this),b=a.data("offset")||{top:a.offset().top-m,left:a.offset().left-n},c=b.top,d=b.left;a.css(transform,gpuAcceleration).stop().animate({top:c,left:d},500,"easeOutCirc",function(){a.css(transform,"")})})}if(!(c.nextLock||c.prevLock||1==c.total||c.lockSwipe)){c.BODY.addClass("ilightbox-closedhand");var k,l=a.originalEvent.touches?a.originalEvent.touches[0]:a,m=$doc.scrollTop(),n=$doc.scrollLeft(),o=[f.eq(0).offset(),f.eq(1).offset(),f.eq(2).offset()],p=[{top:o[0].top-m,left:o[0].left-n},{top:o[1].top-m,left:o[1].left-n},{top:o[2].top-m,left:o[2].left-n}],q={time:(new Date).getTime(),coords:[l.pageX-n,l.pageY-m]};f.bind(touchMoveEvent,i),$doc.one(touchStopEvent,function(a){f.unbind(touchMoveEvent,i),c.BODY.removeClass("ilightbox-closedhand"),q&&k&&("horizontal"==e&&k.time-q.time<1e3&&abs(q.coords[0]-k.coords[0])>h&&abs(q.coords[1]-k.coords[1])k.coords[0]?c.current!=c.total-1||d.infinite?(c.isSwipe=!0,b.moveTo("next")):j():0!=c.current||d.infinite?(c.isSwipe=!0,b.moveTo("prev")):j():"vertical"==e&&k.time-q.time<1e3&&abs(q.coords[1]-k.coords[1])>h&&abs(q.coords[0]-k.coords[0])k.coords[1]?c.current!=c.total-1||d.infinite?(c.isSwipe=!0,b.moveTo("next")):j():0!=c.current||d.infinite?(c.isSwipe=!0,b.moveTo("prev")):j():j()),q=k=undefined})}})},goTo:function(a){var b=this,c=b.vars,d=b.options,e=a-c.current;if(d.infinite&&(a==c.total-1&&0==c.current&&(e=-1),c.current==c.total-1&&0==a&&(e=1)),1==e)b.moveTo("next");else if(-1==e)b.moveTo("prev");else{if(c.nextLock||c.prevLock)return!1;"function"==typeof d.callback.onBeforeChange&&d.callback.onBeforeChange.call(b,b.ui),d.linkId&&(c.hashLock=!0,window.location.hash=d.linkId+"/"+a),b.items[a]&&(b.items[a].options.mousewheel?b.vars.lockWheel=!1:c.lockWheel=!0,b.items[a].options.swipe?c.lockSwipe=!1:c.lockSwipe=!0),$.each([c.holder,c.nextPhoto,c.prevPhoto],function(a,b){b.css(transform,gpuAcceleration).fadeOut(d.effects.loadedFadeSpeed)}),c.current=a,c.next=a+1,c.prev=a-1,b.createUI(),setTimeout(function(){b.generateBoxes()},d.effects.loadedFadeSpeed+50),$(".ilightbox-thumbnail",c.thumbnails).removeClass("ilightbox-active").eq(a).addClass("ilightbox-active"),b.positionThumbnails(),d.linkId&&setTimeout(function(){c.hashLock=!1},55),d.infinite||(c.nextButton.add(c.prevButton).add(c.innerPrevButton).add(c.innerNextButton).removeClass("disabled"),0==c.current&&c.prevButton.add(c.innerPrevButton).addClass("disabled"),c.current>=c.total-1&&c.nextButton.add(c.innerNextButton).addClass("disabled")),b.resetCycle(),"function"==typeof d.callback.onAfterChange&&d.callback.onAfterChange.call(b,b.ui)}},moveTo:function(a){var b=this,c=b.vars,d=b.options,e=d.path.toLowerCase(),f=getViewport(),g=d.effects.switchSpeed;if(c.nextLock||c.prevLock)return!1;var h="next"==a?c.next:c.prev;if(d.linkId&&(c.hashLock=!0,window.location.hash=d.linkId+"/"+h),"next"==a){if(!b.items[h])return!1;var i=c.nextPhoto,j=c.holder,k=c.prevPhoto,l="ilightbox-prev",m="ilightbox-next"}else if("prev"==a){if(!b.items[h])return!1;var i=c.prevPhoto,j=c.holder,k=c.nextPhoto,l="ilightbox-next",m="ilightbox-prev"}"function"==typeof d.callback.onBeforeChange&&d.callback.onBeforeChange.call(b,b.ui),"next"==a?c.nextLock=!0:c.prevLock=!0;var n=$("div.ilightbox-caption",j),o=$("div.ilightbox-social",j);if(n.length&&n.stop().fadeOut(g,function(){$(this).remove()}),o.length&&o.stop().fadeOut(g,function(){$(this).remove()}),b.items[h].caption){b.setCaption(b.items[h],i);var p=$("div.ilightbox-caption",i),q=parseInt(p.outerHeight()/i.outerHeight()*100);d.caption.start&&q<=50&&p.fadeIn(g)}var r=b.items[h].options.social;r&&(b.setSocial(r,b.items[h].URL,i),d.social.start&&$("div.ilightbox-social",i).fadeIn(d.effects.fadeSpeed)),$.each([i,j,k],function(a,b){b.removeClass("ilightbox-next ilightbox-prev")});var s=i.data("offset"),t=f.width-d.styles.pageOffsetX,u=f.height-d.styles.pageOffsetY,v=s.newDims.width,w=s.newDims.height,x=s.thumbsOffset,y=s.diff,z=parseInt(u/2-w/2-y.H-x.H/2),A=parseInt(t/2-v/2-y.W-x.W/2);i.css(transform,gpuAcceleration).animate({top:z,left:A,opacity:1},g,c.isSwipe?"easeOutCirc":"easeInOutCirc",function(){i.css(transform,"")}),$("div.ilightbox-container",i).animate({width:v,height:w},g,c.isSwipe?"easeOutCirc":"easeInOutCirc");var B=j.data("offset"),C=B.object;y=B.diff,v=B.newDims.width,w=B.newDims.height,v=parseInt(v*d.styles["next"==a?"prevScale":"nextScale"]),w=parseInt(w*d.styles["next"==a?"prevScale":"nextScale"]),z="horizontal"==e?parseInt(u/2-C.offsetY-w/2-y.H-x.H/2):parseInt(u-C.offsetX-y.H-x.H/2),"prev"==a?A="horizontal"==e?parseInt(t-C.offsetX-y.W-x.W/2):parseInt(t/2-v/2-y.W-C.offsetY-x.W/2):(z="horizontal"==e?z:parseInt(C.offsetX-y.H-w-x.H/2),A="horizontal"==e?parseInt(C.offsetX-y.W-v-x.W/2):parseInt(t/2-C.offsetY-v/2-y.W-x.W/2)),$("div.ilightbox-container",j).animate({width:v,height:w},g,c.isSwipe?"easeOutCirc":"easeInOutCirc"),j.addClass(l).css(transform,gpuAcceleration).animate({top:z,left:A,opacity:d.styles.prevOpacity},g,c.isSwipe?"easeOutCirc":"easeInOutCirc",function(){j.css(transform,""),$(".ilightbox-thumbnail",c.thumbnails).removeClass("ilightbox-active").eq(h).addClass("ilightbox-active"),b.positionThumbnails(),b.items[h]&&(b.items[h].options.mousewheel?c.lockWheel=!1:c.lockWheel=!0,b.items[h].options.swipe?c.lockSwipe=!1:c.lockSwipe=!0),c.isSwipe=!1,"next"==a?(c.nextPhoto=k,c.prevPhoto=j,c.holder=i,c.nextPhoto.hide(),c.next=c.next+1,c.prev=c.current,c.current=c.current+1,d.infinite&&(c.current>c.total-1&&(c.current=0),c.current==c.total-1&&(c.next=0),0==c.current&&(c.prev=c.total-1)),b.createUI(),b.items[c.next]?b.loadContent(b.items[c.next],"next"):c.nextLock=!1):(c.prevPhoto=k,c.nextPhoto=j,c.holder=i,c.prevPhoto.hide(),c.next=c.current,c.current=c.prev,c.prev=c.current-1,d.infinite&&(c.current==c.total-1&&(c.next=0),0==c.current&&(c.prev=c.total-1)),b.createUI(),b.items[c.prev]?b.loadContent(b.items[c.prev],"prev"):c.prevLock=!1),d.linkId&&setTimeout(function(){c.hashLock=!1},55),d.infinite||(c.nextButton.add(c.prevButton).add(c.innerPrevButton).add(c.innerNextButton).removeClass("disabled"),0==c.current&&c.prevButton.add(c.innerPrevButton).addClass("disabled"),c.current>=c.total-1&&c.nextButton.add(c.innerNextButton).addClass("disabled")),b.repositionPhoto(),b.resetCycle(),"function"==typeof d.callback.onAfterChange&&d.callback.onAfterChange.call(b,b.ui)}),z="horizontal"==e?getPixel(k,"top"):"next"==a?parseInt(-u/2-k.outerHeight()):parseInt(2*z),A="horizontal"==e?"next"==a?parseInt(-t/2-k.outerWidth()):parseInt(2*A):getPixel(k,"left"),k.css(transform,gpuAcceleration).animate({top:z,left:A,opacity:d.styles.nextOpacity},g,c.isSwipe?"easeOutCirc":"easeInOutCirc",function(){k.css(transform,"")}).addClass(m)},setCaption:function(a,b){var c=$('
');a.caption&&(c.html(a.caption),$("div.ilightbox-container",b).append(c))},normalizeSocial:function(a,b){var c=this,d=(c.vars,c.options),e=window.location.href;return $.each(a,function(c,f){if(!f)return!0;var g,h,i=c.toLowerCase();switch(i){case"facebook":g="http://www.facebook.com/share.php?v=4&src=bm&u={URL}",h="Share on Facebook";break;case"twitter":g="http://twitter.com/home?status={URL}",h="Share on Twitter";break;case"googleplus":g="https://plus.google.com/share?url={URL}",h="Share on Google+";break;case"delicious":g="http://delicious.com/post?url={URL}",h="Share on Delicious";break;case"digg":g="http://digg.com/submit?phase=2&url={URL}",h="Share on Digg";break;case"reddit":g="http://reddit.com/submit?url={URL}",h="Share on reddit"}a[c]={URL:f.URL&&absolutizeURI(e,f.URL)||d.linkId&&window.location.href||"string"!=typeof b&&e||b&&absolutizeURI(e,b)||e,source:f.source||g||f.URL&&absolutizeURI(e,f.URL)||b&&absolutizeURI(e,b),text:f.text||h||"Share on "+c,width:void 0===f.width||isNaN(f.width)?640:parseInt(f.width),height:f.height||360}}),a},setSocial:function(a,b,c){var d=this,e=$('
'),f="
    ";a=d.normalizeSocial(a,b),$.each(a,function(a,b){var c=(a.toLowerCase(),b.source.replace(/\{URL\}/g,encodeURIComponent(b.URL).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")));f+='
  • '}),f+="
",e.html(f),$("div.ilightbox-container",c).append(e)},fullScreenAction:function(){var a=this;a.vars;fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen(document.documentElement):fullScreenApi.requestFullScreen(document.documentElement):a.doFullscreen()},doFullscreen:function(){var a=this,b=a.vars,c=getViewport(),d=a.options;if(d.fullAlone){var e=b.holder,f=a.items[b.current],g=c.width,h=c.height,i=[e,b.nextPhoto,b.prevPhoto,b.nextButton,b.prevButton,b.overlay,b.toolbar,b.thumbnails,b.loader],j=[b.loader,b.thumbnails];if(b.isInFullScreen)b.isInFullScreen=b.lockKey=b.lockWheel=b.lockSwipe=!1,b.overlay.css({opacity:a.options.overlay.opacity}),$.each(j,function(a,b){b.show()}),b.fullScreenButton.attr("title",d.text.enterFullscreen),e.data({naturalWidth:e.data("naturalWidthOld"),naturalHeight:e.data("naturalHeightOld"),naturalWidthOld:null,naturalHeightOld:null}),$.each(i,function(a,b){b.removeClass("ilightbox-fullscreen")}),"function"==typeof d.callback.onExitFullScreen&&d.callback.onExitFullScreen.call(a,a.ui);else{if(b.isInFullScreen=b.lockKey=b.lockWheel=b.lockSwipe=!0,b.overlay.css({opacity:1}),$.each(j,function(a,b){b.hide()}),b.fullScreenButton.attr("title",d.text.exitFullscreen),-1!=d.fullStretchTypes.indexOf(f.type))e.data({naturalWidthOld:e.data("naturalWidth"),naturalHeightOld:e.data("naturalHeight"),naturalWidth:g,naturalHeight:h});else{var c=f.options.fullViewPort||d.fullViewPort||"",k=g,l=h,m=e.data("naturalWidth"),n=e.data("naturalHeight");if("fill"==c.toLowerCase())(l=k/m*n)k||n>l,o=a.getNewDimenstions(k,l,m,n,p);k=o.width,l=o.height}e.data({naturalWidthOld:e.data("naturalWidth"),naturalHeightOld:e.data("naturalHeight"),naturalWidth:k,naturalHeight:l})}$.each(i,function(a,b){b.addClass("ilightbox-fullscreen")}),"function"==typeof d.callback.onEnterFullScreen&&d.callback.onEnterFullScreen.call(a,a.ui)}}else b.isInFullScreen?b.isInFullScreen=!1:b.isInFullScreen=!0;a.repositionPhoto(!0)},closeAction:function(){var a=this,b=a.vars,c=a.options;$win.unbind(".iLightBox"),$doc.off(".iLightBox"),b.isInFullScreen&&fullScreenApi.cancelFullScreen(document.documentElement),$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails").off(".iLightBox"),c.hide.effect?b.overlay.stop().fadeOut(c.hide.speed,function(){b.overlay.remove(),b.BODY.removeClass("ilightbox-noscroll").off(".iLightBox")}):(b.overlay.remove(),b.BODY.removeClass("ilightbox-noscroll").off(".iLightBox"));var d=[b.toolbar,b.holder,b.nextPhoto,b.prevPhoto,b.nextButton,b.prevButton,b.loader,b.thumbnails];$.each(d,function(a,b){b.removeAttr("style").remove()}),b.dontGenerateThumbs=b.isInFullScreen=!1,window.iLightBox=null,c.linkId&&(b.hashLock=!0,removeHash(),setTimeout(function(){b.hashLock=!1},55)),"function"==typeof c.callback.onHide&&c.callback.onHide.call(a,a.ui)},repositionPhoto:function(){var a=this,b=a.vars,c=a.options,d=c.path.toLowerCase(),e=getViewport(),f=e.width,g=e.height,h=b.isInFullScreen&&c.fullAlone||b.isMobile?0:"horizontal"==d?0:b.thumbnails.outerWidth(),i=b.isMobile?b.toolbar.outerHeight():b.isInFullScreen&&c.fullAlone?0:"horizontal"==d?b.thumbnails.outerHeight():0,j=b.isInFullScreen&&c.fullAlone?f:f-c.styles.pageOffsetX,k=b.isInFullScreen&&c.fullAlone?g:g-c.styles.pageOffsetY,l="horizontal"==d?parseInt(a.items[b.next]||a.items[b.prev]?2*(c.styles.nextOffsetX+c.styles.prevOffsetX):j/10<=30?30:j/10):parseInt(j/10<=30?30:j/10)+h,m="horizontal"==d?parseInt(k/10<=30?30:k/10)+i:parseInt(a.items[b.next]||a.items[b.prev]?2*(c.styles.nextOffsetX+c.styles.prevOffsetX):k/10<=30?30:k/10),n={type:"current",width:j,height:k,item:a.items[b.current],offsetW:l,offsetH:m,thumbsOffsetW:h,thumbsOffsetH:i,animate:arguments.length,holder:b.holder};a.repositionEl(n),a.items[b.next]&&(n=$.extend(n,{type:"next",item:a.items[b.next],offsetX:c.styles.nextOffsetX,offsetY:c.styles.nextOffsetY,holder:b.nextPhoto}),a.repositionEl(n)),a.items[b.prev]&&(n=$.extend(n,{type:"prev",item:a.items[b.prev],offsetX:c.styles.prevOffsetX,offsetY:c.styles.prevOffsetY,holder:b.prevPhoto}),a.repositionEl(n));var o="horizontal"==d?{left:parseInt(j/2-b.loader.outerWidth()/2)}:{top:parseInt(k/2-b.loader.outerHeight()/2)};b.loader.css(o)},repositionEl:function(a){var b=this,c=b.vars,d=b.options,e=d.path.toLowerCase(),f="current"==a.type&&c.isInFullScreen&&d.fullAlone?a.width:a.width-a.offsetW,g="current"==a.type&&c.isInFullScreen&&d.fullAlone?a.height:a.height-a.offsetH,h=a.item,i=a.item.options,j=a.holder,k=a.offsetX||0,l=a.offsetY||0,m=a.thumbsOffsetW,n=a.thumbsOffsetH;"current"==a.type?("number"==typeof i.width&&i.width&&(f=c.isInFullScreen&&d.fullAlone&&(-1!=d.fullStretchTypes.indexOf(h.type)||i.fullViewPort||d.fullViewPort)?f:i.width>f?f:i.width),"number"==typeof i.height&&i.height&&(g=c.isInFullScreen&&d.fullAlone&&(-1!=d.fullStretchTypes.indexOf(h.type)||i.fullViewPort||d.fullViewPort)?g:i.height>g?g:i.height)):("number"==typeof i.width&&i.width&&(f=i.width>f?f:i.width),"number"==typeof i.height&&i.height&&(g=i.height>g?g:i.height)),g=parseInt(g-$(".ilightbox-inner-toolbar",j).outerHeight());var o="string"==typeof i.width&&-1!=i.width.indexOf("%")?percentToValue(parseInt(i.width.replace("%","")),a.width):j.data("naturalWidth"),p="string"==typeof i.height&&-1!=i.height.indexOf("%")?percentToValue(parseInt(i.height.replace("%","")),a.height):j.data("naturalHeight"),q="string"==typeof i.width&&-1!=i.width.indexOf("%")||"string"==typeof i.height&&-1!=i.height.indexOf("%")?{width:o,height:p}:b.getNewDimenstions(f,g,o,p),r=$.extend({},q,{});"prev"==a.type||"next"==a.type?(o=parseInt(q.width*("next"==a.type?d.styles.nextScale:d.styles.prevScale)),p=parseInt(q.height*("next"==a.type?d.styles.nextScale:d.styles.prevScale))):(o=q.width,p=q.height);var s=parseInt((getPixel(j,"padding-left")+getPixel(j,"padding-right")+getPixel(j,"border-left-width")+getPixel(j,"border-right-width"))/2),t=parseInt((getPixel(j,"padding-top")+getPixel(j,"padding-bottom")+getPixel(j,"border-top-width")+getPixel(j,"border-bottom-width")+$(".ilightbox-inner-toolbar",j).outerHeight())/2);switch(a.type){case"current":var u=parseInt(a.height/2-p/2-t-n/2),v=parseInt(a.width/2-o/2-s-m/2);break;case"next":var u="horizontal"==e?parseInt(a.height/2-l-p/2-t-n/2):parseInt(a.height-k-t-n/2),v="horizontal"==e?parseInt(a.width-k-s-m/2):parseInt(a.width/2-o/2-s-l-m/2);break;case"prev":var u="horizontal"==e?parseInt(a.height/2-l-p/2-t-n/2):parseInt(k-t-p-n/2),v="horizontal"==e?parseInt(k-s-o-m/2):parseInt(a.width/2-l-o/2-s-m/2)}j.data("offset",{top:u,left:v,newDims:r,diff:{W:s,H:t},thumbsOffset:{W:m,H:n},object:a}),a.animate>0&&d.effects.reposition?(j.css(transform,gpuAcceleration).stop().animate({top:u,left:v},d.effects.repositionSpeed,"easeOutCirc",function(){j.css(transform,"")}),$("div.ilightbox-container",j).stop().animate({width:o,height:p},d.effects.repositionSpeed,"easeOutCirc"),$("div.ilightbox-inner-toolbar",j).stop().animate({width:o},d.effects.repositionSpeed,"easeOutCirc",function(){$(this).css("overflow","visible")})):(j.css({top:u,left:v}),$("div.ilightbox-container",j).css({width:o,height:p}),$("div.ilightbox-inner-toolbar",j).css({width:o}))},resume:function(a){var b=this,c=b.vars,d=b.options;!d.slideshow.pauseTime||d.controls.slideshow&&c.total<=1||af.options.maxScale?factor=f.options.maxScale:factor=0,html5H264:!(!b.canPlayType||!b.canPlayType("video/mp4").replace(/no/,"")),html5WebM:!(!b.canPlayType||!b.canPlayType("video/webm").replace(/no/,"")),html5Vorbis:!(!b.canPlayType||!b.canPlayType("video/ogg").replace(/no/,"")),html5QuickTime:!(!b.canPlayType||!b.canPlayType("video/quicktime").replace(/no/,""))}},addContent:function(a,b){var c,d=this;switch(b.type){case"video":var e=!1,f=b.videoType,g=b.options.html5video;("video/mp4"==f||"mp4"==b.ext||"m4v"==b.ext||g.h264)&&d.plugins.html5H264?(b.ext="mp4",b.URL=g.h264||b.URL):g.webm&&d.plugins.html5WebM?(b.ext="webm",b.URL=g.webm||b.URL):g.ogg&&d.plugins.html5Vorbis&&(b.ext="ogv",b.URL=g.ogg||b.URL),!d.plugins.html5H264||"video/mp4"!=f&&"mp4"!=b.ext&&"m4v"!=b.ext?!d.plugins.html5WebM||"video/webm"!=f&&"webm"!=b.ext?!d.plugins.html5Vorbis||"video/ogg"!=f&&"ogv"!=b.ext?!d.plugins.html5QuickTime||"video/quicktime"!=f&&"mov"!=b.ext&&"qt"!=b.ext||(e=!0,f="video/quicktime"):(e=!0,f="video/ogg"):(e=!0,f="video/webm"):(e=!0,f="video/mp4"),e?c=$("